/*
 * parsingUtils.h
 *
 *  Created on: Oct 25, 2011
 *      Author: shaohong
 */

#ifndef PARSINGUTILS_H_
#define PARSINGUTILS_H_

#include <stdbool.h>
#include <string.h>

typedef enum {
	NORMAL_LINE, IN_BLOCK_COMMENTING
} ParserState;

typedef struct {
	char * codeLine;
	ParserState parserState;
} LineParsingContext;

bool isEmptyLine(const char * line);

/* clean the source code for the given file */
int cleanSourceCode(const char * sourceFileName);

/**
 * Cancel the code cleaning job (due to interruption from the user)
 */
void cancelCleaning();

/**
 * extract the "valuable" code from the given line.
 * @param initialContext the context of the parser,
 * i.e. the codeLine to parse and the parserState before parsing happens.
 *
 * return LineParsingContext the result of parsing the initialContext
 *
 */
LineParsingContext * getCodePartFromLine(LineParsingContext * initialContext);

#endif /* PARSINGUTILS_H_ */
